<%--
    Document   : loanapplication
    Created on : Apr 6, 2011, 3:37:32 PM
    Author     : Dine
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
    <head>
        <sj:head jqueryui="true" jquerytheme="south-street" compressed="false"/>
        <jsp:include page="WEB-INF/fragments/globalHead.html"/>
        <script src="resources/jquery/jquery.metadata.js" type="text/javascript"></script>
        <script src="resources/jquery/jquery.validate.js" type="text/javascript"></script>
        <title>Cashmate <s:property value="#session.branch.branchname"/></title>
        <style type="text/css">
            .autocomplete{
                font-size: 10px;
            }
            div.container {
                background-color: #eee;
                border: 1px solid red;
                margin: 5px;
                padding: 5px;
            }
            div.container ol li {
                list-style-type: disc;
                margin-left: 20px;
            }
            div.container { display: none }
            .container label.error {
                display: inline;
            }
            .tabs{
                font-size: 11px;
            }
            /*            #loan, #borrower, #spouse, #business, #coborrower, #requirements{
                            overflow: auto;
                            height: 320px;
                        }
                        #loanborrowerinfo, #ci, #appraisal{
                            overflow: auto;
                            height: 480px;
                        }*/
            .info{
                font-weight: bold;
                color: black;
                font-size: 13px;
            }
            .disable{
                cursor: default !important; 
                background-color: grey !important;
            }

            h4{
                color: #459E00;
            }

        </style> <!--main.jsp css-->
        <script type="text/javascript">
            function myPopup(a){
                if(a=="loanapplications"){
                    var s = document.getElementById("applicationimage").value;
                    var url="http://localhost:8080/Cashmate/photo.jsp?fn="+s+"&type="+a;
                    var name = "Application"
                    window.open(url,name,"resizable=no,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,width="+500+",height="+500+",left="+500+",top="+500+"");
                }
                
                if(a=="creditinvestigations"){
                    var s = document.getElementById("ciimage").value;
                    var name = "CI"
                    var url="http://localhost:8080/Cashmate/photo.jsp?fn="+s+"&type="+a;
                    window.open(url,name,"resizable=no,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,width="+500+",height="+500+",left="+500+",top="+500+"");
                }
                
                if(a=="appraisals"){
                    var s = document.getElementById("appraisalimage").value;
                    var url="http://localhost:8080/Cashmate/photo.jsp?fn="+s+"&type="+a;
                    var name = "Appraisal"
                    window.open(url,name,"resizable=no,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,width="+500+",height="+500+",left="+500+",top="+500+"");
                }
                    
            }
            
            function postLoanApp(){
                var r=confirm("Are you sure you want to post this loan application now? Once posted, it will now be submitted to the Head Office and can no longer be edited. \n\
        \n\Click OK to continue posting or Cancel to do otherwise.");
                if (r==true)
                {
                    document.loanapplicationform.submit();
                }
            }
            
            function postAF(){
                var r=confirm("Are you sure you want to post this application form? Once posted, it will now be submitted to the Head Office and can no longer be edited. \n\
        \n\Click OK to continue posting or Cancel to do otherwise.");
                if (r==true)
                {
                    document.loanappform.submit();
                }
            }
            
            function postCI(){
                var r=confirm("Are you sure you want to post this credit investigation? Once posted, it will now be submitted to the Head Office and can no longer be edited. \n\
        \n\Click OK to continue posting or Cancel to do otherwise.");
                if (r==true)
                {
                    document.creditform.submit();
                }
            }
            
            function postAP(){
                var r=confirm("Are you sure you want to post this appraisal? Once posted, it will now be submitted to the Head Office and can no longer be edited. \n\
        \n\Click OK to continue posting or Cancel to do otherwise.");
                if (r==true)
                {
                    document.appraisalform.submit();
                }
            }
        
        </script>
    </head>
    <body>

        <c:if test="${sessionScope.auth == null || sessionScope.auth == false}">
            <%--<jsp:forward page="index.jsp?auth=none"/>--%>
        </c:if>
        <s:div id="bodyContainer">
            <s:div id="contentContainerProfile" cssClass="ui-widget-content ui-corner-all">
                <s:action name="get-products" executeResult="false" var="p"/>
                <s:action name="get-areascoll" executeResult="false" var="a"/>
                <s:action name="get-requirements" executeResult="false" var="r"/>
                <s:action executeResult="false" name="get-profile-loanapp" var="gp">
                    <s:param name="loanverid" value="%{#parameters['id']}" />
                </s:action>
                <s:div id="theContent">
                    <script type="text/javascript">
                        $('h1#contentHeader').html('<span id="level1">Loan Profile</span>');
                    </script>
                    <jsp:include page="WEB-INF/fragments/profile-loanapp.jsp" />
                </s:div> 
            </s:div>
            <s:div id="bottomContainer1" cssClass="ui-widget-content ui-corner-all">
                <span id="copyright">&copy; Cashmate Credit Corporation 2011</span>
                <%--    <span id="themeSpan">
                        <s:select id="theme"
                                   label="Theme"
                                   name="selectedTheme"
                                   list="{'south-street','trontastic','cupertino','human','ui-lightness'}"
                                   value="south-street"
                                   />
                    </span>
                --%>
            </s:div>
        </s:div>

        <s:set name="stat" value="actionstatus"/>
        <s:if test="%{#stat!=null}">
            <input style="display: none" id="actionstatustext" value="<s:property value="#stat"/>"></input>
            <script>
                var a = document.getElementById("actionstatustext").value;
                alert(a);
            </script>
        </s:if>
    </body>
</html>
